import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-12-04
 * Time: 16:49
 */
public class Demo2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        while(scan.hasNext()) {
            int n = scan.nextInt();

            String[] array = new String[n];
            boolean[] fly = new boolean[n];
            for(int i = 0; i < n; i++) {
                array[i] = scan.next();
            }

            //按照字典排序
            Arrays.sort(array);

            //过滤相同目录和子目录
            for(int i = 0; i < n - 1; i++) {
                if(array[i].equals(array[i+1])) {
                    fly[i] = true;
                }else if(array[i].length() < array[i+1].length() && array[i+1].contains(array[i]) && array[i+1].charAt(array[i].length()) == '/') {
                    fly[i] = true;
                }
            }

            for(int i = 0; i < n; i++) {
                if(!fly[i]) {
                    System.out.println( "mkdir -p " + array[i]);
                }
            }
            System.out.println();
        }
    }
}
